<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='${ctx}/static/admin/assets/js/jquery.js'>" + "<" + "/script>");
</script>
<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='${ctx}/static/admin/assets/js/jquery1x.js'>" + "<" + "/script>");
</script>
<![endif]-->

<script type="text/javascript">
    if ('ontouchstart' in document.documentElement) document.write("<script src='${ctx}/static/admin/assets/js/jquery.mobile.custom.js'>" + "<" + "/script>");
</script>
<script src="${ctx}/static/admin/assets/js/bootstrap.js"></script>

<!-- page specific plugin scripts -->
<!--[if lte IE 8]>
<script src="${ctx}/static/admin/assets/js/excanvas.js"></script>
<![endif]-->

<!--<script src="${ctx}/static/admin/assets/js/jquery.gritter.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/bootbox.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/flot/jquery.flot.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/flot/jquery.flot.pie.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/flot/jquery.flot.resize.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/jquery.hotkeys.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/bootstrap-wysiwyg.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/select2.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/select2_locale_zh-CN.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/x-editable/bootstrap-editable.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/x-editable/ace-editable.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/jquery.knob.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/chosen.jquery.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/fuelux/fuelux.spinner.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/spin.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/bootstrap-colorpicker.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/jquery.autosize.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/jquery.inputlimiter.1.3.1.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/jquery.maskedinput.js"></script>-->
<!--<script src="${ctx}/static/admin/assets/js/bootstrap-tag.js"></script>-->


<!-- common scripts -->

<!--<script src="${ctx}/static/admin/assets/js/nubia-common-js-1.js"></script>-->
<script src="${ctx}/static/admin/assets/js/jquery.gritter.js"></script>
<script src="${ctx}/static/admin/assets/js/bootbox.js"></script>
<script src="${ctx}/static/admin/assets/js/flot/jquery.flot.js"></script>
<script src="${ctx}/static/admin/assets/js/flot/jquery.flot.pie.js"></script>
<script src="${ctx}/static/admin/assets/js/flot/jquery.flot.resize.js"></script>
<script src="${ctx}/static/admin/assets/js/x-editable/bootstrap-editable.js"></script>
<script src="${ctx}/static/admin/assets/js/x-editable/ace-editable.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.hotkeys.js"></script>
<script src="${ctx}/static/admin/assets/js/bootstrap-wysiwyg.js"></script>
<script src="${ctx}/static/admin/assets/js/select2.js"></script>
<script src="${ctx}/static/admin/assets/js/select2_locale_zh-CN.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.knob.js"></script>


<script src="${ctx}/static/admin/assets/js/nubia-common-js-2.js"></script>
<!--nubia-common-js-2.js included
<script src="${ctx}/static/admin/assets/js/chosen.jquery.js"></script>
<script src="${ctx}/static/admin/assets/js/fuelux/fuelux.spinner.js"></script>
<script src="${ctx}/static/admin/assets/js/spin.js"></script>
<script src="${ctx}/static/admin/assets/js/bootstrap-colorpicker.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.autosize.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.inputlimiter.1.3.1.js"></script>
<script src="${ctx}/static/admin/assets/js/jquery.maskedinput.js"></script>
<script src="${ctx}/static/admin/assets/js/bootstrap-tag.js"></script>
--->

<!-- datetime scripts -->

<script src="${ctx}/static/admin/assets/js/date-time/moment.js"></script>
<script src="${ctx}/static/admin/assets/js/date-time/locales.js"></script>
<script src="${ctx}/static/admin/assets/js/date-time/bootstrap-datepicker.js"></script>
<script src="${ctx}/static/admin/assets/js/date-time/bootstrap-datepicker.zh-CN.js"></script>

<script src="${ctx}/static/admin/assets/js/date-time/bootstrap-timepicker.js"></script>
<script src="${ctx}/static/admin/assets/js/date-time/daterangepicker.js"></script>
<script src="${ctx}/static/admin/assets/js/date-time/bootstrap-datetimepicker.js"></script>



<!-- ace scripts -->
<script src="${ctx}/static/admin/assets/js/ace/ace-common-js-min-1.js"></script>
<!--ace-common-js-min-1.js included
<script src="${ctx}/static/admin/assets/js/ace/elements.colorpicker.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.fileinput.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.scroller.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.typeahead.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.wysiwyg.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.spinner.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.treeview.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.wizard.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/elements.aside.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.ajax-content.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.touch-drag.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.sidebar.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.sidebar-scroll-1.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.submenu-hover.js"></script>
--->
<script src="${ctx}/static/admin/assets/js/ace/ace-common-js-min-2.js"></script>
<!--ace-common-js-min-2.js included
<script src="${ctx}/static/admin/assets/js/ace/ace.widget-box.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.settings.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.settings-rtl.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.settings-skin.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.widget-on-reload.js"></script>
<script src="${ctx}/static/admin/assets/js/ace/ace.searchbox-autocomplete.js"></script>
--->

<script src="${ctx}/static/admin/assets/js/jquery.blockUI.js"></script>
<!-- 根据传入的ID来动态的为某个选项附加选中样式 -->
<script>
    var currentMenu = '${currentMenu!'
    dashBoard
    '}';
    var arr = currentMenu.split("-");
    var menuLevel = arr.length;
    if (menuLevel > 1) {
        for (var i = 0; i < menuLevel; i++) {

            if (i == (menuLevel - 1)) {
                $("#" + arr[menuLevel - 1]).addClass("active");
            } else {
                $("#" + arr[i]).addClass("active open");
            }
        }
    } else {
        $("#" + arr).addClass("active");
    }

    $(document).ready(function(){

        var currModuleId = '${moduleId}';
        $("#"+currModuleId).addClass("dark");

        $(".menuli a").click(function(event){
            event.preventDefault();
            $url=$(this).attr("href");
            if($url.startWith("http")){
                $height=$(document).height();
                $(".main-content").html('<iframe src="'+$url+'" height="'+$height+'" width="100%"></iframe>');
                return false;
            }else{
                window.location="${ctx}"+$url;
//                $.get($url, { },function(data){
//                    if(data){
//                        $(".main-content").html(data);
//                    }
//                });
            }
            return false;
        });

        $(".pageA").click(function(event){
            event.preventDefault();
            $pageNo=$(this).attr("pageNo");
            $("#pageNo").val($pageNo);
            $url = $("#searchForm").attr("action");
            $("#searchForm").submit();
            return false;
        });
        $("#searchBtn").on(ace.click_event, function(){
            $("#pageNo").val(1);
            $url = $("#searchForm").attr("action");
            $("#searchForm").submit();
        });

    });
    function reload(url){
        if(url.startWith("http")){
            $height=$(document).height()*0.7;
            $(".main-content").html('<iframe src="'+url+'" height="'+$height+'" width="100%"></iframe>');
            return false;
        }else{
            $.get(url, { },function(data){
                if(data){
                    console.log('hide')
                    $("body").removeClass("modal-open");
                    $("#editModal").modal("hide");
                    $(".main-content").html(data);
                }
            });
        }
    }

    function ajaxSend(ajaxUrl,reloadUrl){
        $.get(ajaxUrl, { },function(data){
            if(data){
                reload(reloadUrl);
            }
        });
    }


    function timeCompareFailed(startTime, endTime) {
        if(endTime == "" || startTime=="")return false;
        var arr = startTime.split("-");
        var starttime = new Date(arr[0], arr[1], arr[2]);
        var starttimes = starttime.getTime();

        var arrs = endTime.split("-");
        var lktime = new Date(arrs[0], arrs[1], arrs[2]);
        var lktimes = lktime.getTime();

        if (starttimes >= lktimes) {
            return true;
        }else{
            return false;
        }
    }

    String.prototype.endWith=function(s){
        if(s==null||s==""||this.length==0||s.length>this.length)
            return false;
        if(this.substring(this.length-s.length)==s)
            return true;
        else
            return false;
        return true;
    }

    String.prototype.startWith=function(s){
        if(s==null||s==""||this.length==0||s.length>this.length)
            return false;
        if(this.substr(0,s.length)==s)
            return true;
        else
            return false;
        return true;
    }



</script>
${pageJavascript}